
#if !defined(HYPERSPHERE_H)
#define HYPERSPHERE_H

#include "nr_c/nr.h"
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;

// Purpose: Define a region in space. Can query whether a given point
// is present in region.
class Hypersphere
{

public:

  // constructor which also define an initial region according
  // to the solution and radius provided
  Hypersphere(int numDimension, double *solution, double radius);

  // empty contructor. And initial region will be empty.
  Hypersphere() {} 

  // constructor which we might want to use later
  Hypersphere(const vector<double> &solution, double radius);

  // overwrite or set hypersphere region
  void setRegion(int numDimension, double *solution, double radius);
  void setRegion(int numDimension, double *solution, double radius, double funcval);
  void setRegion(double *solution, double radius);
  void setRegion(const vector<double> &solution, double radius);

  // returns a 'boolean' diguised as an int
  bool isInRegion(int numDimension, double *solution);

  // here you assume you that the dimension of your solution is the same as the
  // dimension of the hypersphere
  bool isInRegion(double *solution);

  // might want to use in the future
  bool isInRegion(const vector<double> &solution);

  void test();

  ~Hypersphere() {}

  Hypersphere& Hypersphere::operator=(const Hypersphere& p) 
  {
    m_radius = p.m_radius;
    m_solution = p.m_solution;   
    return *this;

    //cout << "called assignment constructor of Hypersphere\n";
  }

  Hypersphere(const Hypersphere& p) 
  {
    m_radius = p.m_radius;
    m_solution = p.m_solution;

    //cout << "called copy constructor of Hypersphere\n";
  }
    double m_radius;
    double m_funcval;

private:




  // hypersphere defined by a point plus a radius

  vector<double> m_solution;
  //double m_radius;
  
};

#endif // !defined(HYPERSPHERE_H)
